<%@ page language="java" contentType="text/html; charset=UTF-8" import="org.springframework.ui.ModelMap" import="java.util.*,com.device.operating.entity.*"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../xasj/js/jquery-1.4.js"></script>
<script type="text/javascript" src="../xasj/js/framework.js"></script>
<link href="../xasj/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link href="../xasj/css/skins/sky/import_skin.css" rel="stylesheet" type="text/css" themeColor="blue"/>
<script type="text/javascript">
function test(){
    var cb = document.getElementById('cbox');
    cb.checked;
}

function go(url) {
	window.location.href = url;
	}
function add(){
document.getElementById('fields').submit();	
}
</script>
</head>
<body>
<form id='fields' action="" method='post'>
<div class="box2" panelTitle="功能面板" roller="false">
		<table>
			<tr>
				<td>请选择数据表：</td>
				<td>
            <%if(request.getAttribute("dlist")==null){}else{
            List<Devres> list=(List<Devres>)request.getAttribute("dlist");
					for(Devres d:list){
						if(request.getAttribute("dvfield")!=null&&d.getDvbelong().equals(request.getAttribute("fdl"))){
						%><label><input type="radio" checked="checked" name="fbelong" value="<%=d.getDvbelong()%>"onclick="javascript:window.location.href='showdvsec?dvbelong=<%=d.getDvbelong()%>'"/><%=d.getDevresname()%></label>
						<%
					}else{
				%>
     <label><input type="radio" name="fbelong" value="<%=d.getDvbelong()%>"onclick="javascript:window.location.href='showdvsec?dvbelong=<%=d.getDvbelong()%>'"/><%=d.getDevresname()%></label>
            <%
					}}}
				%>
          </select></td></tr>
		</table>
</div>
<div class="box2" panelTitle="查询条件列表" roller="false">
		<table class="tableStyle">
				<%if(request.getAttribute("dvsec")==null){}else{
		        List<Fieldres> lis=(List<Fieldres>)request.getAttribute("dvsec");
		        List<String[]> fx=(List<String[]>)request.getAttribute("fuxuan");
		        		int i=0;
					for(Fieldres c:lis){%><tr><%//遍历每个选择字段
						%><td><%=c.getFieldname()%>:</td>
				        <%if(c.getSectype().equals("1")){//单选
				        	%><td><select name="danxuan" colNum="5" class="validate[required]"><option  value="">无<%
						        String[] str=fx.get(i++);		        	
						        for(int t=0;t<str.length;t++){//获取所有单选框的取值
						        %><option  value="<%=str[t]+","+c.getFieldId()%>"><%=str[t]%></option><%
						        }//显示复选框取值
						        %></select></td><%
				        }
				        else if(c.getSectype().equals("2")){//复选
				        	%><td><input type="text" name="fufield" value="<%=c.getFieldId()%>"style="display:none"/><%
				        	String[] str=fx.get(i++);
				        for(int t=0;t<str.length;t++){//获取所有复选框的取值
				        	%><input type="checkbox" name="fuxuan" value="<%=c.getFieldId()+","+str[t]%>"/><%=str[t]%><%
				        }//显示复选框取值
				        %></td><%
				        }
				        else if(c.getSectype().equals("4")){//字符
				        	%><td><input type="text" name="zf"/><input type="text" name="zfield" value="<%=c.getFieldId()%>"style="display:none"/></td>
				        	<%
				        }else{//日期
				        	
				        }
				       }
					}//end if
				%></td>		
		</table>
</div>
<div class="box2" panelTitle="需要显示的字段" id="scrollContent">
<%					if(request.getAttribute("dvfield")==null){}else{
			        List<Fieldres> li=(List<Fieldres>)request.getAttribute("dvfield");
					for(Fieldres d:li){//需要显示的字段
									%>
						<td><input type="checkbox" name="fshow" <%if(d.isIfshow()==true){%>checked="checked"<%}%>  value=<%=d.getFieldId()%> /><%=d.getFieldname()%></td>
				<%
					}}
				%>
</div>
<div class="box2" >
<input type='submit' onclick="javascript:this.form.action='/xasj/showdevicelist';"value='提交' >
</form>
</div>
</body>
</html>